<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <a href="login.html"><input type="button" value="返回首页"><br></a><br>
    <hr>
    <table id="brandTable" border="1" cellspacing="0" width="100%">
        <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>书名</th>
            <th>联系方式</th>
            <th>借书时间</th>
            <th>归还时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>

        <!--
            使用v-for遍历tr
        -->

        <tr v-for="(logs,i) in logs" align="center">
            <td>{{i + 1}}</td>
            <td>{{logs.user_name}}</td>
            <td>{{logs.sex}}</td>
            <td>{{logs.book_name}}</td>
            <td>{{logs.phon}}</td>
            <td>{{logs.head_time}}</td>
            <td>{{logs.end_time}}</td>
            <td>{{logs.statusStr}}</td>
            <td><a href="#">修改</a> <a href="#">删除</a></td>
        </tr>


    </table>
</div>
<script src="../js/axios-0.18.0.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script src="../element-ui/lib/index.js"></script>
<link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css">
<script>
    new Vue({
        el: "#app",
        data(){
            return{
                logs:[]
            }
        },
        mounted(){
            // 页面加载完成后，发送异步请求，查询数据
            var _this = this;
            axios({
                method:"get",
                url:"http://localhost:8080/bookLibary_war/selectServlet2"
            }).then(resp=>{
                _this.logs = resp.data;
            })
        }
    })
</script>

</body>
</html>